import request from "@/utils/request.js";

export function sendMessage(uuid, message) {
    const data = {
        uuid,
        message
    }
    return request({
        url: '/chat/chat/send',
        method: 'post',
        data: data
    })
}

export function getChatHistory(userId){
    return request({
        url: '/chat/chat/chatHistory?userId=' + userId,
        method: 'get',
    })
}

export function delChatHistory(userId){
    return request({
        url: '/chat/chat/' + userId,
        method: 'delete',
    })
}

export function constantChat(uuid, message) {
    const data = {
        uuid,
        message
    }
    return request({
        url: '/chat/chat/memory',
        method: 'post',
        data: data
    })
}

export function chatStream(uuid, message) {
    return request({
        url: '/chat/sse/stream?userId=' + uuid + '&message=' + message,
        method: 'post',
    })
}
